import { defHttp } from "@/utils/http";
// ERP 科室单据类型 VO
export interface DeptDocTypeVO {
	id: number; // 主键,示例值(25542)
	deptId: string; // 科室代码,示例值(30345)
	type: number; // 单据类型代码,示例值(1)
	effectiveDate: Date; // 生效日期
	statusFlag: number; // 启用状态标记(1:启用, 0:禁用)
}

// ERP 科室单据类型 API
export const DeptDocTypeApi = {
	// 查询科室单据类型分页
	getDeptDocTypePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/receipt-dept-ex/page`, params });
	},

	// 查询科室单据类型详情
	getDeptDocType: async (id: number) => {
		return await defHttp.get({ url: `/whs/receipt-dept-ex/get?id=` + id });
	},

	// 新增科室单据类型
	createDeptDocType: async (data: DeptDocTypeVO) => {
		return await defHttp.post({ url: `/whs/receipt-dept-ex/create`, data });
	},

	// 修改科室单据类型
	updateDeptDocType: async (data: DeptDocTypeVO) => {
		return await defHttp.put({ url: `/whs/receipt-dept-ex/update`, data });
	},

	// 删除科室单据类型
	deleteDeptDocType: async (id: number) => {
		return await defHttp.delete({ url: `/whs/receipt-dept-ex/delete?id=` + id });
	},

	// 导出科室单据类型 Excel
	exportDeptDocType: async (params: any) => {
		return await defHttp.download({ url: `/whs/receipt-dept-ex/export-excel`, params });
	}
};
